﻿using System;
using System.Collections.Generic;
using System.Text;

using NGE;

namespace MH
{
    [Serializable]
    public class Prop
    {
        public Prop()
        {
            GenerateNewGUID();
            Name = "";
        }

        public NImage ICON;

        public string SkinFileName;
        public string BulletFileName;
        public string HitFileName;

        public string SkinSoundFileName;
        public string BulletSoundFileName;
        public string HitSoundFileName;

        public Guid GUID;

        public string Name;
        public int Type;
        public string Description;
        public int RequestLevel;
        public double Weight;
        public int Worth;
        public string Script;
        
        protected double damage;
        protected double defense;
        protected double accurate;
        protected double missrate;
        protected double armor;

        public double Damage
        {
            get
            {
                //double t = (double)Quality / 100;
                double t = 1;
                return t * damage;
            }
            set
            {
                damage = value;
            }
        }
        public double Defense
        {
            get
            {
                //double t = (double)Quality / 100;
                double t = 1;
                return t * defense;
            }
            set
            {
                defense = value;
            }
        }
        public double Accurate
        {
            get
            {
                //double t = (double)Quality / 100;
                double t = 1;
                return t * accurate;
            }
            set
            {
                accurate = value;
            }
        }
        public double Missrate
        {
            get
            {
                //double t = (double)Quality / 100;
                double t = 1;
                return t * missrate;
            }
            set
            {
                missrate = value;
            }
        }
        public double Armor
        {
            get
            {
                //double t = (double)Quality / 100;
                double t = 1;
                return t * armor;
            }
            set
            {
                armor = value;
            }
        }

        double load;
        int endure;
        int time;
        //int range;
        int rangeMin;
        int rangeMax;

        int square;
        public int Square
        {
            get
            {
                return square;
            }
            set
            {
                square = value;
            }
        }

        public int SquareType;

        public double Load
        {
            get
            {
                return load;
            }
            set
            {
                load = value;
            }
        }
        public int Endure
        {
            get
            {
                return endure;
            }
            set
            {
                endure = value;
            }
        }
        public int Time
        {
            get
            {
                return time;
            }
            set
            {
                time = value;
            }
        }
        public int RangeMin
        {
            get
            {
                return rangeMin;
            }
            set
            {
                rangeMin = value;
            }
        }
        public int RangeMax
        {
            get
            {
                return rangeMax;
            }
            set
            {
                rangeMax = value;
            }
        }

        public void GenerateNewGUID()
        {
            GUID = Guid.NewGuid();
        }
    }
    public struct PropType
    {
        public const int Supply = 0;
        public const int Tool = 1;
               
        public const int Weapon = 10;
        public const int Body = 11;
        public const int Leg = 12;
        public const int Foot = 13;
        public const int Head = 14;
        public const int Hand = 15;
        public const int Ring = 16;
        public const int Necklace = 17;

        public const int PrimaryWeapon = 20;
        public const int SecondryWeapon = 21;
        public const int SpecialWeapon = 22;
        public const int Engine = 23;
        public const int ECU = 24;
    }
}
